package com.kaifamiao.custom;

public class DataAccess {
	
	public void save( String name ) throws DataAccessException {
		if( name == null || name.trim().isEmpty() ) {
			throw new DataAccessException( "姓名不可以为空" );
		}
		System.out.println( "保存" + name + "到数据库" );
	}

	public static void main(String[] args) {
		DataAccess da = new DataAccess();
		System.out.println( "begin" );
		try {
			da.save( "姜禹志" );
		} catch (DataAccessException e) {
			e.printStackTrace();
		}
		System.out.println( "end" );
	}

}
